home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / quicktime / effects / makeeffectslideshow / makeeffectslideshow.h < prev    next >
Encoding:
Text File  |  2000-09-28  |  3.0 KB  |  100 lines

  1. //////////
  2. //
  3. //    File:        MakeEffectSlideShow.h
  4. //
  5. //    Contains:    QuickTime video effect support for QuickTime movies.
  6. //                This file is used for BOTH MacOS and Windows.
  7. //
  8. //    Written by:    Tim Monroe
  9. //                Based (heavily!) on the MakeEffectSlideShow code written by Sam Bushell.
  10. //
  11. //    Copyright:    © 1994-1997 by Apple Computer, Inc., all rights reserved.
  12. //
  13. //    Change History (most recent first):
  14. //
  15. //       <1>         11/06/97    rtm        first file; integrated existing code with shell framework
  16. //       
  17. //////////
  18.  
  19. //////////
  20. //
  21. // header files
  22. //
  23. //////////
  24.  
  25. #include "ComApplication.h"
  26.  
  27. #include <ImageCodec.h>
  28.  
  29. #if TARGET_OS_MAC
  30. #include "MacFramework.h"
  31. #endif
  32.  
  33. #if TARGET_OS_WIN32
  34. #include "WinFramework.h"
  35. #endif
  36.  
  37.  
  38. //////////
  39. //
  40. // compiler flags and macros
  41. //
  42. //////////
  43.  
  44. #define USES_MAKE_IMAGE_DESC_FOR_EFFECT    1        // use MakeImageDescriptionForEffect (QT 4.0 and later)
  45.  
  46. #define    BailNil(n)                        if (!n) { if (!myErr) myErr = -1; goto bail; }
  47. #define    BailError(n)                    if (n) { if (!myErr) myErr = -1; goto bail; }
  48.  
  49. #define MAKE_STILL_SECTIONS                0        // should we bother with the non-effect parts of the movie?
  50.  
  51.  
  52. //////////
  53. //
  54. // constants
  55. //
  56. //////////
  57.  
  58. #define kMaxNumSources                    100        // the maximum number of input tracks we will collect
  59. #define kTimeScale                        600
  60.  
  61. #if MAKE_STILL_SECTIONS
  62. #define    kStillDuration                    (2*kTimeScale)
  63. #define    kEffectDuration                    (1*kTimeScale)
  64. #define kMinimumDuration                (kEffectDuration + kStillDuration + kEffectDuration)
  65. #else
  66. #define    kStillDuration                    0
  67. #define    kEffectDuration                    (2*kTimeScale)
  68. #define kMinimumDuration                (kEffectDuration + kStillDuration + kEffectDuration)
  69. #endif
  70.  
  71. #define kNoSourceName                    FOUR_CHAR_CODE('none')
  72. #define kSourceOneName                    FOUR_CHAR_CODE('srca')
  73. #define kSourceTwoName                    FOUR_CHAR_CODE('srcb')
  74.  
  75. // constants to pick out portions of a track; use these as parameters to QTEffects_CopyPortionOfTrackToTrack
  76. enum {
  77.     eStartPortion            = 1,        // the first kEffectDuration of a track
  78.     eMiddlePortion            = 2,        // the part between eStartPortion and eFinishPortion
  79.     eFinishPortion            = 4            // the last kEffectDuration of a track
  80. };
  81.  
  82.  
  83. //////////
  84. //
  85. // function prototypes
  86. //
  87. //////////
  88.  
  89. OSErr                                QTEffects_GetFirstVideoTrackInMovie (Movie theMovie, Track *theTrack);
  90. PicHandle                            QTEffects_GetPosterPictFromFirstVideoTrackInMovieFile (FSSpec *theSpec);
  91. OSErr                                QTEffects_CopyPortionOfTrackToTrack (Track theSourceTrack, UInt16 theSourcePortions, Track theDestTrack, TimeValue theDestStartTime, TimeValue *theDestDuration);
  92. OSErr                                QTEffects_DisplayDialogForSources (FSSpec *theSpecList, UInt16 theSpecCount);
  93. void                                QTEffects_RespondToDialogSelection (OSErr theErr);
  94. # if TARGET_OS_WIN32
  95. static void                            QTEffects_EffectsDialogCallback (EventRecord *theEvent, DialogRef theDialog, DialogItemIndex theItemHit);
  96. LRESULT CALLBACK                    QTEffects_CustomDialogWndProc (HWND theWnd, UINT theMessage, UINT wParam, LONG lParam);
  97. #endif
  98. Boolean                                QTEffects_HandleEffectsDialogEvents (EventRecord *theEvent, DialogItemIndex theItemHit);
  99. void                                QTEffects_PromptUserForFilesAndMakeEffect (void);
  100.